﻿@model SoftHotel.Models.Proveedor

@{
    ViewBag.Title = "Agregar";
}

@using (Html.BeginForm())
{
   <h1><strong>Formulario Nuevo Proveedor</strong></h1>
   @Html.ValidationSummary(true)
   <fieldset>
        <legend>Proveedor</legend>
    
    
    <table id="MainContent_Table1" rules="none" style="border-color: Black; width: 900px; margin-bottom: 0px;">
        <tr>
		    <td style="width: 20px;"></td>
		    <td style="font-weight: bold; width: 220px;" align="">Razón Social </td>
		    <td style="width: 220px;"> 
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.razonSocial)
                    @Html.ValidationMessageFor(model => model.razonSocial)
                </div>
            </td>
		    <td style="font-weight: bold; width: 220px;">Representante  </td>
		    <td style="width: 194px;"> 
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.representante)
                    @Html.ValidationMessageFor(model => model.representante)
                </div>
            </td>
	    </tr>
        <tr>
		    <td style="width: 20px;"></td>
		    <td style="font-weight: bold; width: 220px;" align=""> RUC </td>
		    <td style="width: 220px;"> 
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.ruc)
                    @Html.ValidationMessageFor(model => model.ruc)
                </div>
            </td>
		    <td style="font-weight: bold; width: 220px;">DNI Representante </td>
		    <td style="width: 194px;">  
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.dniRepresentante)
                    @Html.ValidationMessageFor(model => model.dniRepresentante)
                </div>
            </td>
	    </tr>
        <tr>
		    <td style="width: 20px;"></td>
		    <td style="font-weight: bold; width: 220px;" align=""> Dirección </td>
		    <td style="width: 220px;"> 
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.direccion)
                    @Html.ValidationMessageFor(model => model.direccion)
                </div>
            </td>
		    <td style="font-weight: bold; width: 220px;">Celular </td>
		    <td style="width: 194px;">  
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.movil)
                    @Html.ValidationMessageFor(model => model.movil)
                </div>
            </td>
	    </tr>
        <tr>
		    <td style="width: 20px;"></td>
		    <td style="font-weight: bold; width: 220px;" align=""> E-mail </td>
		    <td style="width: 220px;">
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.email)
                    @Html.ValidationMessageFor(model => model.email)
                </div>
            </td>
		    <td style="font-weight: bold; width: 220px;">Teléfono</td>
		    <td style="width: 194px;">  
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.telefono)
                    @Html.ValidationMessageFor(model => model.telefono)
                </div>
            </td>
		</tr>
    </table>

<br/> 
<br/>
<input value="Aceptar" type="submit"  name="button" />	
<input value="Regresar"type="submit" name ="button"/>
    </fieldset>
}

@*/
        <h2>
            Detalle Proveedores Agregados
        </h2>
	

<table id="añadir" rules="all" style="background-color: #BDBDBD; width: 900px; margin-bottom: 0px;" border="1">

	<tr>
        <td><input type="submit" name="button" value="Añadir" /> 
		</td>
	</tr>
</table>	
  <table id="MainContent_Table2" rules="all" style="border-color: Black; width: 900px; margin-bottom: 0px;" border="1">
	<tr>
		<td style="font-weight: bold; width: 460px;" align="center">Proveedor</td>
		<td style="font-weight: bold; width: 120px;" align="center">RUC</td>
		<td style="font-weight: bold; width: 135px;" align="center">Telefono</td>
		<td style="font-weight: bold; width: 65px;" align="center">Representante</td>
		<td style="font-weight: bold; width: 20px;" align="center">E</td>
	</tr>
    @{
                             int i = 0;
                             foreach (var prov in (System.Collections.Generic.List<SoftHotel.Models.Proveedor>)ViewBag.ListaProveedores)
                             {
            <tr>
		        <td style="font-weight: bold; width: 350px;" align="center"><a href = "/Proveedor/Detalle?razon=@prov.razon">@prov.razon</a></td>
		        <td style="font-weight: bold; width: 120px;" align="center">@prov.ruc</td>
		        <td style="font-weight: bold; width: 70px;" align="center">@prov.fono</td>
		        <td style="font-weight: bold; width: 20px;" align="center">@prov.representante</td>
                <td style="font-weight: bold; width: 20px;" align="center">E</td>
	        </tr>
                                 i++;
                             }
    }       


</table>

<br/>
<br/>

<input value="Guardar" type="submit"  name="button" />	
<input value="Cancelar"type="submit" name ="button"/>
	
<br/>       
}
*@